﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HNG.LIB.Common;
using HNG.Portal.BLL;
using HNG.Portal.DAL;
using HNG.Portal.DAL.EntityClasses;
using HNG.Portal.DAL.FactoryClasses;
using HNG.Portal.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Text;
public partial class Controls_Common_SlideImages : System.Web.UI.UserControl
{
    TblBannerManager _TblBannersManager = new TblBannerManager();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //GetBannerCenter
            StringBuilder sb = new StringBuilder();
            TblBannerEntity _TblBannerEntity = new TblBannerEntity();
            _TblBannerEntity.Type = "slide";
            _TblBannerEntity.Status = "1";
            DataTable _dtSlide = _TblBannersManager.fe_selectToSlideHome(_TblBannerEntity);
            sb.Append("<ul id='slider1Content'>");
            if (_dtSlide != null)
            {
                if (_dtSlide.Rows.Count > 0)
                    for (int i = 0; i < _dtSlide.Rows.Count; i++)
                    {
                        DataRow r=_dtSlide.Rows[i];
                        sb.Append("<li class='slider1Image'>");
                        sb.Append("<a href='" + ResolveUrl(r[TblBannerFields.Url.Name].ToString()) + "'><img src='" + ResolveUrl("~/Thumbnailer.ashx?type=slideshow&file=" + r[TblBannerFields.Image.Name]) + "' alt='" + i + 1 + "' border='0' /></a>");
                        sb.Append("<span class='left'><strong>" + r[TblBannerFields.TenBanner.Name] + "</strong><br />" + r[TblBannerFields.MoTa.Name] + "</span></li>");
                    }
            }
            sb.Append("<div class='clear slider1Image'></div></ul>");
            lblAnhQC.Text = sb.ToString();
        }
    }
}